|
|
|
|
|
|
|
The MDI form has two special properties that you should be aware of: |
|
|
|
|
|
|
|
|
AutoShowChildren specifies whether any child forms in the project are shown automatically as they're loaded. When this property is set, the child forms are shown as soon as they're loaded. This means that the Load statement and Show method behave the same when executed in your application. |
|
|
|
|
|
|
|
|
When ScrollBars is set to True, scrollbars appear automatically on the MDI parent form if any child form or section of a child form is moved beyond the boundary of the parent form (see Figure 3.9). If the property is set to False, scrollbars aren't displayed under any circumstances. |
|
|
|
|
|
|
|
|
Figure 3.9.
With scrollbars, you can have the
MDI form contain child forms that are
larger than the parent. |
|
|
|
|
|
|
|
|
Now, add a child form to the project that contains a TextBox control. Setting up a child form is actually easier than setting up the parent form. A child form is just a standard form with its MDIChild property set to True. Thus, everything you know about working with standard forms applies to creating child forms for an MDI application. |
|
|
|
|
|
|
|
|
In fact, for your application's first child form, you can use the form that's already added to your project and just change its MDIChild property to True. After you change this property, you'll see that the icon for the form changes to an MDI child icon. This is the only visible change that you see while you remain in design mode. After you have a child form, add the TextBox control to the form. Now, set the properties shown in Table 3.1 for the different objects in your project. |
|
|
|
|
| TABLE 3.1.MDINotepadPROJECT PROPERTIES. | | Object | Property | Value | | FrmMDINotepad | Caption | MDI Notepad Demo | | Form1 | Name | frmNote | | Caption | (blank) | | | |
|
|
|